<template>
  <div class="profile">
    <div class="profile-nav">
      <nav-bar>
        <div slot="center">我的商城</div>
      </nav-bar>
    </div>
    <!-- 1.用户登录信息 -->
    <user-info></user-info>
    <!-- 2.用户关于钱 -->
    <div class="user-money-list">
      <user-money v-for="item in userMoney" :key="item.id">
        <span slot="money">{{ item.money }}</span>
        <span slot="money-name">{{ item.moneyName }}</span>
      </user-money>
    </div>
    <!-- 3.封装成一个整体 -->
    <list-view :list-data="orderList" class="order-list"></list-view>
    <list-view :list-data="serviceList" class="service-list"></list-view>
  </div>
</template>
<script>
import NavBar from "components/common/navBar/NavBar";
import UserInfo from "./childComps/UserInfo";
import UserMoney from "./childComps/UserMoney";
import ListView from "./childComps/ListView";
export default {
  name: "Profile",
  components: {
    NavBar,
    UserInfo,
    UserMoney,
    ListView,
  },
  data() {
    return {
      userMoney: [
        {
          id: 1,
          money: "0.00",
          moneyName: "我的余额",
        },
        {
          id: 2,
          money: "52.00",
          moneyName: "我的优惠",
        },
        {
          id: 3,
          money: "0.00",
          moneyName: "我的积分",
        },
      ],
      orderList: [
        {
          icon: "#order",
          iconColor: "#ff8198",
          info: "我的消息",
          img: require("@/assets/img/profile/message.svg"),
        },
        {
          icon: "#point",
          iconColor: "#fc7b53",
          info: "积分商城",
          img: require("@/assets/img/profile/pointer.svg"),
        },
        {
          icon: "#vip",
          iconColor: "#ffc636",
          info: "会员卡",
          img: require("@/assets/img/profile/vip.svg"),
        },
      ],
      serviceList: [
        {
          icon: "#service",
          iconColor: "#ff8198",
          info: "我的购物车",
          img: require("@/assets/img/profile/cart.svg"),
        },
        {
          icon: "#download",
          iconColor: "#ff8198",
          info: "下载购物APP",
          img: require("@/assets/img/profile/shopping.svg"),
        },
      ],
    };
  },
};
</script>
<style lang="scss" scoped>
.profile {
  position: relative;
  height: 100vh;
  background: #eee;
}
.profile-nav {
  background: var(--color-high-text);
  color: #fff;
  // position: fixed;
  // top: 0;
  // left: 0;
  // right: 0;
  z-index: 10;
}
.user-money-list {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.order-list,
.service-list {
  margin-top: 12px;
}
</style>
